import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/Home'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/Home',
                    component: resolve => require(['../components/page/Home.vue'], resolve),
                    meta: { title: '系统首页' }
                },{
                    path: '/goodsPool',
                    component: resolve => require(['../components/page/goodsManager/goodsPool.vue'], resolve),
                    meta: { title: '商品池' }
                },{
                    path: '/goodsPoolDetail',
                    component: resolve => require(['../components/page/goodsManager/goodsPoolDetail.vue'], resolve),
                    meta: { title: '商品池详情' }
                },{
                    path: '/goodsListDetail',
                    component: resolve => require(['../components/page/goodsManager/goodsListDetail.vue'], resolve),
                    meta: { title: '商品列表详情' }
                },{
                    path: '/deliveryArea',
                    component: resolve => require(['../components/page/goodsManager/deliveryArea.vue'], resolve),
                    meta: { title: '配送区域' }
                },{
                    path: '/goodsList',
                    component: resolve => require(['../components/page/goodsManager/goodsList.vue'], resolve),
                    meta: { title: '商品列表' }
                },{
                    path: '/allOrder/order',
                    component: resolve => require(['../components/page/ordersManager/order.vue'], resolve),
                    meta: { title: '全部订单' }
                },{
                    path: '/allOrder/payOrder',
                    component: resolve => require(['../components/page/ordersManager/payOrder.vue'], resolve),
                    meta: { title: '已支付' }
                },{
                    path: '/allOrder/cancelingOrder',
                    component: resolve => require(['../components/page/ordersManager/cancelingOrder.vue'], resolve),
                    meta: { title: '取消中' }
                },{
                    path: '/allOrder/cancelOrder',
                    component: resolve => require(['../components/page/ordersManager/cancelOrder.vue'], resolve),
                    meta: { title: '已取消' }
                },{
                    path: '/orderDetail',
                    component: resolve => require(['../components/page/ordersManager/orderDetail.vue'], resolve),
                    meta: { title: '订单详情' }
                },{
                    path: '/applyAfterSale',
                    component: resolve => require(['../components/page/afterSaleManager/applyAfterSale.vue'], resolve),
                    meta: { title: '申请售后' }
                },{
                    path: '/submitApply',
                    component: resolve => require(['../components/page/afterSaleManager/submitApply.vue'], resolve),
                    meta: { title: '提交申请' }
                },{
                    path: '/afterSale/order',
                    component: resolve => require(['../components/page/afterSaleManager/order.vue'], resolve),
                    meta: { title: '全部售后订单' }
                },{
                    path: '/afterSale/examining',
                    component: resolve => require(['../components/page/afterSaleManager/examining.vue'], resolve),
                    meta: { title: '审核中' }
                },{
                    path: '/afterSale/waitReturn',
                    component: resolve => require(['../components/page/afterSaleManager/waitReturn.vue'], resolve),
                    meta: { title: '待退货' }
                },{
                    path: '/afterSale/sending',
                    component: resolve => require(['../components/page/afterSaleManager/sending.vue'], resolve),
                    meta: { title: '寄送中' }
                },{
                    path: '/afterSale/receivedExamining',
                    component: resolve => require(['../components/page/afterSaleManager/receivedExamining.vue'], resolve),
                    meta: { title: '收货审核中' }
                },{
                    path: '/afterSale/alreadyReturn',
                    component: resolve => require(['../components/page/afterSaleManager/alreadyReturn.vue'], resolve),
                    meta: { title: '已退款' }
                },{
                    path: '/afterSale/reject',
                    component: resolve => require(['../components/page/afterSaleManager/reject.vue'], resolve),
                    meta: { title: '驳回' }
                },{
                    path: '/afterSale/cancel',
                    component: resolve => require(['../components/page/afterSaleManager/cancel.vue'], resolve),
                    meta: { title: '已取消' }
                },{
                    path: '/afterSaleDetail',
                    component: resolve => require(['../components/page/afterSaleManager/afterSaleDetail.vue'], resolve),
                    meta: { title: '售后订单详情' }
                },{
                    path: '/recharge/orderList',
                    component: resolve => require(['../components/page/fictionRecharge/orderList.vue'], resolve),
                    meta: { title: '虚拟充值订单列表' }
                },{
                    path: '/recharge/goodsList',
                    component: resolve => require(['../components/page/fictionRecharge/goodsList.vue'], resolve),
                    meta: { title: '虚拟充值商品列表' }
                },{
                    path: '/recharge/switchAccount',
                    component: resolve => require(['../components/page/fictionRecharge/switchAccount.vue'], resolve),
                    meta: { title: '账号切换' }
                },{
                    path: '/recharge/password',
                    component: resolve => require(['../components/page/fictionRecharge/password.vue'], resolve),
                    meta: { title: '账号和密码' }
                },{
                    path: '/ascriptionCity',
                    component: resolve => require(['../components/page/ascriptionCity.vue'], resolve),
                    meta: { title: '归属地' }
                },
                {
                    path: '/icon',
                    component: resolve => require(['../components/page/Icon.vue'], resolve),
                    meta: { title: '自定义图标' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: resolve => require(['../components/page/Upload.vue'], resolve),
                    meta: { title: '文件上传' }   
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: resolve => require(['../components/page/DragDialog.vue'], resolve),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../components/page/Permission.vue'], resolve),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: resolve => require(['../components/page/404.vue'], resolve),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: resolve => require(['../components/page/403.vue'], resolve),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
